package com.come4loves.game.module.skill.buffImpl;

import org.springframework.stereotype.Component;

import com.come4loves.game.dataconfig.model.BuffEffectConfig;
import com.come4loves.game.module.fight.action.BatchAction;
import com.come4loves.game.module.fight.action.BuffAction;
import com.come4loves.game.module.fight.constants.BuffType;
import com.come4loves.game.module.fight.model.BuffData;
import com.come4loves.game.module.fight.model.FightCard;
import com.come4loves.game.module.skill.AbstractBuffParser;
/**
 * 圣盾
 * @author jerry
 *
 */
@Component
public class HolyshieldImpl extends AbstractBuffParser {

	@Override
	public String buffId() {
		return "holyshield";
	}

	@Override
	public void parse(FightCard attackerCard,FightCard targetCard, BuffEffectConfig cfg, BatchAction batchAction) {
		if (checkBuffAdd(targetCard, cfg, BuffType.HOLYSHIELD)){
			BuffData buffData = new BuffData(attackerCard.getId(),BuffType.HOLYSHIELD, Integer.valueOf(cfg.getBuffnum()), cfg.getDuration());
			targetCard.addBuff(buffData);
			BuffAction buffAction = new BuffAction(targetCard, buffData, 1);
			batchAction.addAction(buffAction);
		}
			
	}

}
